<template>
	<view class="box" :style="{'min-height':minHeight}">
		<view class="item">
			<view class="long-time">测评次数:{{data.paper_count}}/{{data.all_count}}</view>
			<view 
				class="box-top"
				:style="{color:data.is_pass == 0 ? '#ff4d4f':'#4A87FD'}"
			>{{data.is_pass==0?'不合格':"合格"}}</view>
			<view class="progress">
				<!-- <u-circle-progress 
					:active-color="data.is_pass==0? '#ff4d4f':'#4A87FD'" 
					:percent="data.score"
				>
					<view class="u-progress-content">
						<view class="u-progress-dot">{{data.score}}</view>
						<text class='u-progress-info'>总分{{data.total_score}}分</text>
					</view>
				</u-circle-progress> -->
				<view class="u-progress-content">
					<view class="u-progress-dot">{{data.score}}</view>
					<text class='u-progress-info'>总分{{data.total_score}}分</text>
				</view>
			</view>
			<view class="item-card">
				<view class="item-card-item">
					<view class="item-card-item-num">
						{{data.exam_time}}
					</view>
					<view class="item-card-item-intro">
						答题时长	
					</view>
				</view>
				<view class="line"></view>
				<view class="item-card-item">
					<view class="item-card-item-num">
						{{data.yes_num}}题
					</view>
					<view class="item-card-item-intro">
						答对	
					</view>
				</view>
				<view class="item-card-item">
					<view class="item-card-item-num">
						{{data.cuo_num}}题
					</view>
					<view class="item-card-item-intro">
						答错	
					</view>
				</view>
				<view class="item-card-item">
					<view class="item-card-item-num">
						{{data.wei_num}}题
					</view>
					<view class="item-card-item-intro">
						未答
					</view>
				</view>
			</view>
			
			<view class="button">
				<u-button
				shape="circle"
				type="primary"
				ripple="true"
				@click='backIntroduction'
				>关闭</u-button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				minHeight:'100px',
				data:{}
			}
		},
		onLoad(option) {
			uni.getSystemInfo({
				success: (res) => {
					this.minHeight = res.windowHeight+"px"
				}
			})
			this.data = option
		},
		onUnload() {
			let pages = getCurrentPages()
			if(pages.length === 4){
				uni.navigateBack({
					delta:1
				})
			}else if(pages.length === 5){
				uni.navigateBack({
					delta:2
				})
			}else{
				uni.switchTab({
					url:"/pages/tabbar/study/index",
				})
			}
		},
		methods: {
			backIntroduction(){
				uni.navigateBack()	
			}
		}
	}
</script>

<style lang="less" scoped>
	
	.button{
		width: 80%;
		margin: auto;
		margin-top: 80rpx;
	}
	
	.box-top{
		font-size: 34rpx;
		font-family: PingFangSC, PingFangSC-Medium;
		font-weight: 500;
		text-align: center;
		
		line-height: 48rpx;
	}
	.progress{
		margin: 32rpx 0;
		display:flex;
		justify-content: center;
		.u-progress-content{
			display:flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			.u-progress-dot{
				font-size: 40rpx;
				font-family: DINPro, DINPro-Medium;
				font-weight: 500;
				text-align: center;
				color: #222222;
				line-height:52rpx;
			}
			.u-progress-info{
				font-size: 22rpx;
				font-family: PingFangSC, PingFangSC-Regular;
				font-weight: 400;
				text-align: center;
				color: #737373;
				line-height: 30rpx;
			}
		}
	}
	.fenshu{
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 42rpx;
		font-family: DINPro, DINPro-Medium;
		font-weight: 500;
	}
	.line{
		height: 80rpx;
		border-left:1rpx solid #dbdbdb;
	}
	.item-card-item-intro{
		text-align: center;
		font-size: 20rpx;
		font-family: PingFangSC, PingFangSC-Regular;
		font-weight: 400;
		color: #7f7f7f;
		line-height: 28rpx;
	}
	.item-card-item-num{
		text-align: center;
		font-size: 28rpx;
		font-family: PingFangSC, PingFangSC-Medium;
		font-weight: 500;
		color: #333333;
		line-height: 40rpx;
		margin-bottom: 12rpx;
	}
	.item-card{
		box-sizing: border-box;
		padding: 24rpx 0rpx;
		background: #f6f6f6;
		border-radius: 18rpx;
		display: flex;
		justify-content: space-evenly;
		.item-card-item{
			display: flex;
			flex-direction: column;
		}
	}
	.long-time{
		font-size: 26rpx;
		font-family: PingFangSC, PingFangSC-Regular;
		font-weight: 400;
		color: #7f7f7f;
		line-height: 36rpx;
		text-align: right;
	}
	.item{
		background-color: #fff;
		border-radius: 18rpx;
		box-sizing: border-box;
		padding:20rpx 32rpx 32rpx 32rpx;
	}
	.box{
		box-sizing: border-box;
		padding: 24rpx;
		background-color: #f7f7f7;
	}
</style>
